package com.achen.controller;

import com.achen.entity.Menu;
import com.achen.service.MenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author achen
 * @create 2020-04-30 15:15
 */
@RestController
@RequestMapping("/menu")
@Slf4j
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("/findAll")
    public List<Menu> findAll(){
        List<Menu> list = null;
        try {
            list = menuService.findAll();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}
